package com.shicijiaoliu.pojo;


import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import net.minidev.json.annotate.JsonIgnore;

import java.time.LocalDateTime;

@Data
public class User {

  @NotNull
  private long id;
  private String username;
  @JsonIgnore //返回json时忽略该属性
  private String password;
  @NotEmpty
  @Pattern(regexp = "^\\S{1,15}$") //昵称1到15位
  private String nickname;
  @Email
  private String email;
  private String userPic;
  private LocalDateTime createTime;
  private LocalDateTime updateTime;
  private String ruler;
  private String phone;
  private String events;
  private long age;
  private String sex;
  private String hobby;


    public User(String username, String nickname, String email, String phone, long id, String ruler,String sex,long age,String hobby) {
      this.username = username;
      this.nickname = nickname;
      this.email = email;
      this.phone = phone;
      this.id = id;
      this.ruler = ruler;
      this.sex = sex;
      this.age = age;
      this.hobby = hobby;
    }
    public User(){}
}
